{{csrf_field()}}
<div  class="layui-form">

    <div class="layui-form-item">
        <label class="layui-form-label">父级菜单：</label>
        <div class="layui-input-block">
            <select  name="parent_id" xm-select-direction="down" xm-select="select1" xm-select-search-type="dl" xm-select-search xm-select-radio="">
                @if(isset($menus))
                    <option value="0" @if(isset($info->parent_id) && 0==$info->parent_id) selected @endif >根节点</option>
                @foreach($menus as $key =>$val)
                        <option value="{{$val['id']}}" @if(isset($info->parent_id) && $val['id']==$info->parent_id) selected @endif>{{$val['cat_name']}}</option>
                    @endforeach
                @endif
            </select>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">标题</label>
        <div class="layui-input-block">
            <input type="text" name="title"   value="{{$info->title ?? old('title')}}" autocomplete="off" placeholder="" class="layui-input">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">图标：</label>
        <div class="layui-input-block">
            <input type="text" name="icon" value="{{$info->icon ?? old('icon')}}"  autocomplete="off" class="layui-input">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">路径：</label>
        <div class="layui-input-block">
            <input type="text" name="uri" value="{{$info->uri ?? old('uri')}}"  placeholder="输入路径" autocomplete="off" class="layui-input">
        </div>
    </div>


    <div class="layui-form-item">
        <label class="layui-form-label">角色</label>
        <div class="layui-input-block">

            <select lay-verify="required" lay-reqText="请选择分类" name="roles_id" xm-select-direction="down" xm-select="roles_id" xm-select-search-type="dl" xm-select-search>
                @if(isset($roles))
                    @foreach($roles as $key =>$val)
                        <option value="{{$val['id']}}" @if(isset($checkArrR) && in_array($val['id'],$checkArrR)) selected @endif>{{$val['name']}}</option>
                    @endforeach
                @endif
            </select>
        </div>
    </div>
    {{--<div class="layui-form-item">
        <label class="layui-form-label">权限</label>
        <div class="layui-input-block">

            <select lay-verify="required" lay-reqText="请选择分类" name="permissions_id" xm-select-direction="down" xm-select="permissions_id" xm-select-search-type="dl" xm-select-search>
                @if(isset($permissions))
                    @foreach($permissions as $key =>$val)
                        <option value="{{$val['id']}}" @if(isset($checkArrP) && in_array($val['id'],$checkArrP)) selected @endif>{{$val['name']}}</option>
                    @endforeach
                @endif
            </select>
        </div>
    </div>--}}

    <div class="layui-form-item">
        <div class="layui-input-block">
            <button class="layui-btn" lay-filter="post-submit" lay-submit>保 存</button>
        </div>
    </div>
  </div>
@section('script')
    <link rel="stylesheet" href="{{ asset('static/admin/css/formSelects-v4.css') }}">
    <script>
        layui.use(['layer', 'form','jquery','formSelects','laydate'], function(){
            var layer = layui.layer,
                form =layui.form,
                laydate=layui.laydate,
                $  = layui.jquery;

            laydate.render({
                elem: '#date' //指定元素
            });
            //监听提交
            form.on('submit(post-submit)', function(data){

            });
        });
    </script>
@endsection